package cn.wolfcode.crm.query;

import cn.wolfcode.crm.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class ChartQueryObject extends QueryObject{
    private String groupType = "seller.name";

    private String sellerName;
    @DateTimeFormat(pattern = "y-M-d")
    private Date beginDate;
    @DateTimeFormat(pattern = "y-M-d")
    private Date endDate;

    public String getSellerName() {
        return empty2Null(sellerName);
    }

    //处理结束时间为当天最后一秒
    public Date getEndDate(){
        return DateUtil.getEndDate(endDate);
    }
}
